import Taro, { Component } from '@tarojs/taro'
import { View, Text, Button } from '@tarojs/components'
import NewsItem from '../../components/NewsItem/NewsItem'
import applySuccessImg from '../../images/stage/applySuccess.png'
import './applySuccess.scss'

export default class Applysuccess extends Component {

  config = {
    navigationBarTitleText: '申请成功'
  }

  componentWillMount(){
    let {nid,pid}=this.$router.params
    Taro.request({
      url:"http://101.37.65.67/loudi-poc/demand/"+nid+"/product/"+pid,
      method:"GET"
    }).then(res=>{
      console.log(res)
    })
  }

  handleBtnSeeprocedure(){
    let {nid,pid}=this.$router.params
    Taro.redirectTo({url:'/pages/finance/financeConfirm/financeConfirm?nid='+nid+'&pid='+pid})
  }

  render () { 
    return (
      <View className='applySuccess'>
        <View className='applyResult'>
          <Image mode="widthFix" src={applySuccessImg}></Image>
          <Text>申请成功</Text>
          <Button type='primary' onClick={this.handleBtnSeeprocedure}>查看融资进度</Button>
        </View>
        <View className="newsRecommend">
          <View className="newsRecommend_title_row">
            <View className="newsRecommend_title">相关动态</View>
            <View className="newsRecommend_change">
              <View className="newsRecommend_change_icon"></View>换一批
            </View>
          </View>
          <View className="newsRecommend_content">
            <NewsItem url='1' title='湖南省人民政府办公厅关于印发《湖南省优化经济发展环境规定》的通知' time='2019.05.24' source='来源：中国政府网'></NewsItem>
            <NewsItem url='1' title='娄底市人民政府关于加快推进现代服务业发展的若干意见' time='2019.05.24' source='来源：中国政府网'></NewsItem>
            <NewsItem url='1' title='娄底市人民政府关于加快推进现代服务业发展的若干意见' time='2019.05.24' source='来源：中国政府网'></NewsItem>
          </View>
        </View>
      </View> 
    )
  }
}
